import React,{Component} from 'react'
import {TopicBox,TopicItem} from '../style'
import {connect} from 'react-redux';
class Topic extends Component{
    constructor(){
        super();
    }
    render(){
        return(
            <React.Fragment>
               <TopicBox>
                   {
                       this.props.topicList.map((item,index)=>{
                           return(
                            <TopicItem key={index}>
                                <img className='img-topic' src={item.get('src')}></img>
                                <span className='title'>{item.get('title')}</span>
                            </TopicItem>
                           )
                       })
                   }
               </TopicBox>

            </React.Fragment>
        )
     }
}
const mapStateToProps = (state)=>{
    return{
        topicList:state.get('home').get('topicList'),
    }
}
export default connect(mapStateToProps,null)(Topic);